<include file="Public/min-header" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/common.js" type="text/javascript"></script>
<style type="text/css">
	#tab_tongyong .table-bordered tr td input {
		display: initial;
	}
</style>
<!--以下是在线编辑器 代码 -->
<script type="text/javascript">
	/*
	 * 在线编辑器相 关配置 js 
	 *  参考 地址 http://fex.baidu.com/ueditor/
	 */
	window.UEDITOR_Admin_URL = "__ROOT__/Public/plugins/Ueditor/";
	var URL_upload = "{$URL_upload}";
	var URL_fileUp = "{$URL_fileUp}";
	var URL_scrawlUp = "{$URL_scrawlUp}";
	var URL_getRemoteImage = "{$URL_getRemoteImage}";
	var URL_imageManager = "{$URL_imageManager}";
	var URL_imageUp = "{$URL_imageUp}";
	var URL_getMovie = "{$URL_getMovie}";
	var URL_home = "{$URL_home}";
</script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.all.min.js">
</script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	//具体参数配置在  editor_config.js  中
	var options = {
		zIndex: 999,
		initialFrameWidth: "95%", //初化宽度
		initialFrameHeight: 400, //初化高度
		focus: false, //初始化时，是否让编辑器获得焦点true或false
		maximumWords: 99999,
		removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign', //允许的最大字符数 'fullscreen',
		pasteplain: true,
		autoHeightEnabled: true,
		autotypeset: {
			mergeEmptyline: true, //合并空行
			removeClass: true, //去掉冗余的class
			removeEmptyline: false, //去掉空行
			textAlign: "left", //段落的排版方式，可以是 left,right,center,justify 去掉这个属性表示不执行排版
			imageBlockLine: 'center', //图片的浮动方式，独占一行剧中,左右浮动，默认: center,left,right,none 去掉这个属性表示不执行排版
			pasteFilter: false, //根据规则过滤没事粘贴进来的内容
			clearFontSize: false, //去掉所有的内嵌字号，使用编辑器默认的字号
			clearFontFamily: false, //去掉所有的内嵌字体，使用编辑器默认的字体
			removeEmptyNode: false, // 去掉空节点
			//可以去掉的标签
			removeTagNames: {
				"font": 1
			},

			indent: false, // 行首缩进
			indentValue: '0em' //行首缩进的大小
		},
		toolbars: [
			['fullscreen', 'source', '|', 'undo', 'redo',
				'|', 'bold', 'italic', 'underline', 'fontborder',
				'strikethrough', 'superscript', 'subscript',
				'removeformat', 'formatmatch', 'autotypeset',
				'blockquote', 'pasteplain', '|', 'forecolor',
				'backcolor', 'insertorderedlist',
				'insertunorderedlist', 'selectall', 'cleardoc', '|',
				'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
				'customstyle', 'paragraph', 'fontfamily', 'fontsize',
				'|', 'directionalityltr', 'directionalityrtl',
				'indent', '|', 'justifyleft', 'justifycenter',
				'justifyright', 'justifyjustify', '|', 'touppercase',
				'tolowercase', '|', 'link', 'unlink', 'anchor', '|',
				'imagenone', 'imageleft', 'imageright', 'imagecenter',
				'|', 'insertimage', 'emotion', 'insertvideo',
				'attachment', 'map', 'gmap', 'insertframe',
				'insertcode', 'webapp', 'pagebreak', 'template',
				'background', '|', 'horizontal', 'date', 'time',
				'spechars', 'wordimage', '|',
				'inserttable', 'deletetable',
				'insertparagraphbeforetable', 'insertrow', 'deleterow',
				'insertcol', 'deletecol', 'mergecells', 'mergeright',
				'mergedown', 'splittocells', 'splittorows',
				'splittocols', '|', 'print', 'preview', 'searchreplace'
			]
		]
	};
</script>
<!--以上是在线编辑器 代码  end-->

<if condition="$goodsInfo[is_promote] neq 1">
	<style>
		.is_promote {
			display: none;
		}
	</style>
</if>

<div class="wrapper">
	<include file="Public/breadcrumb" />
	<section class="content">
		<!-- Main content -->
		<div class="container-fluid">
			<div class="pull-right">

				<a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title"><i class="fa fa-list"></i>路线详情</h3>
				</div>
				<div class="panel-body">
					<ul class="nav nav-tabs">
						<li class="active">
							<a href="#tab_tongyong" data-toggle="tab">基本信息</a>
						</li>
						<!--                        <li><a href="#tab_goods_desc" data-toggle="tab">描述信息</a></li>-->
						<li>
							<a href="#tab_goods_info" data-toggle="tab">产品详情</a>
						</li>
						<li>
							<a href="#tab_goods_schedule" data-toggle="tab" onclick="render_init()">行程安排</a>
						</li>
						<!--<li>
							<a href="#tab_goods_fee" data-toggle="tab">费用说明</a>
						</li>-->
						<!--<li>
							<a href="#tab_goods_notice" data-toggle="tab">预定须知</a>
						</li>-->
					</ul>
					<!--表单数据-->
					<form method="post" id="addEditGoodsForm">
						<input type="hidden" value="{$_GET['id']}" name="id" />
						<!--通用信息-->
						<div class="tab-content">
							<div class="tab-pane active" id="tab_tongyong">

								<table class="table table-bordered">
									<tbody>
										<tr>
											<td>名称:</td>
											<td>
												<input type="text" value="{$baseinfo.name}" name="baseinfo[name]" class="form-control" v style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>价格:</td>
											<td>
												<input type="text" value="{$baseinfo.price}" name="baseinfo[price]" class="form-control" style="width:350px;" />

											</td>
										</tr>

										<tr>
											<td>出发点:</td>
											<td>
												<input type="text" value="{$baseinfo.startplace}" name="baseinfo[startplace]" class="form-control" style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>目的地</td>
											<td>
												<volist name="desc" id="vo">

													<input type="radio" value="{$vo.value}" name="baseinfo[destination]" <if condition="$destination eq $vo['value']"> checked</if> />{$vo.desc}&nbsp;&nbsp;

												</volist>
											</td>

										</tr>
										<tr>
											<td>主题:</td>
											<td>
												<input type="radio" <if condition="$topic  eq 'family'"> checked="checked"</if> name="baseinfo[topic]" value="family" /> 家庭亲子&nbsp;&nbsp;
												<input type="radio" <if condition="$topic  eq 'romantic'"> checked="checked"</if> name="baseinfo[topic]" value="romantic" /> 蜜月之行&nbsp;&nbsp;
												<input type="radio" <if condition="$topic  eq 'classic'"> checked="checked"</if> name="baseinfo[topic]" value="classic" />畅游经典&nbsp;&nbsp;
												<input type="radio" <if condition="$topic  eq 'delicious'"> checked="checked"</if> name="baseinfo[topic]" value="delicious" />美酒美食&nbsp;&nbsp;
												<input type="radio" <if condition="$topic  eq 'explore'"> checked="checked"</if> name="baseinfo[topic]" value="explore" />畅游经典&nbsp;&nbsp;
											</td>
										</tr>
										
										<tr>
											<td>推荐热门:</td>
											<td>
												<input type="checkbox" <if condition="$hotcity  eq  1"> checked="checked"</if> name="baseinfo[hotcity]" /> 热门城市&nbsp;&nbsp;
												<input type="checkbox" <if condition="$ishot eq  1"> checked="checked"</if> name="baseinfo[ishot]" /> 热门主题&nbsp;&nbsp;
										
											</td>
										</tr>
								
										
										<tr>
											<td>行程天数(天):</td>
											<td>
												<input type="text" value="{$baseinfo.scheduleday}" name="baseinfo[scheduleday]" class="form-control" style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>酒店说明:</td>
											<td>
												<input type="text" value="{$baseinfo.hotel_intro}" name="baseinfo[hotel_intro]" class="form-control" style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>车导说明:</td>
											<td>
												<input type="text" value="{$baseinfo.guide_intro}" name="baseinfo[guide_intro]" class="form-control" style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>航班说明:</td>
											<td>
												<input type="text" value="{$baseinfo.flight_intro}" name="baseinfo[flight_intro]" class="form-control" style="width:350px;" />

											</td>
										</tr>
										<tr>
											<td>亮点:</td>
											<td>
												<textarea rows="6" cols="50" name="baseinfo[feature]">{$baseinfo.feature}</textarea>
											</td>
										</tr>
										<!--<tr>
											<td>商品分类:</td>
											<td>
												<div class="col-xs-3">
													<select name="cat_id" id="cat_id" onchange="get_category(this.value,'cat_id_2','0');" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
														<foreach name="cat_list" item="v" key="k">
															<option value="{$v['id']}" <if condition="$v['id'] eq $level_cat['1']">selected="selected"</if> > {$v['name']}
															</option>
														</foreach>
													</select>
												</div>
												<div class="col-xs-3">
													<select name="cat_id_2" id="cat_id_2" onchange="get_category(this.value,'cat_id_3','0');" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
													</select>
												</div>
												<div class="col-xs-3">
													<select name="cat_id_3" id="cat_id_3" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
													</select>
												</div>
												<span id="err_cat_id" style="color:#F00; display:none;"></span>
											</td>
										</tr>
										<tr>
											<td>扩展分类:</td>
											<td>
												<div class="col-xs-3">
													<select name="extend_cat_id" id="extend_cat_id" onchange="get_category(this.value,'extend_cat_id_2','0');" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
														<foreach name="cat_list" item="v" key="k">
															<option value="{$v['id']}" <if condition="$v['id'] eq $level_cat2['1']">selected="selected"</if> > {$v['name']}
															</option>
														</foreach>
													</select>
												</div>
												<div class="col-xs-3">
													<select name="extend_cat_id_2" id="extend_cat_id_2" onchange="get_category(this.value,'extend_cat_id_3','0');" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
													</select>
												</div>
												<div class="col-xs-3">
													<select name="extend_cat_id_3" id="extend_cat_id_3" class="form-control" style="width:250px;margin-left:-15px;">
														<option value="0">请选择商品分类</option>
													</select>
												</div>
												<span id="err_cat_id" style="color:#F00; display:none;"></span>
											</td>
										</tr>-->

										<!--<tr>
											<td>商品品牌:</td>
											<td>
												<select name="brand_id" id="brand_id" class="form-control" style="width:250px;">
													<option value="">所有品牌</option>
													<foreach name="brandList" item="v" key="k">
														<option value="{$v['id']}" <if condition="$v['id'] eq $goodsInfo['brand_id'] ">selected="selected"</if>> {$v['name']}
														</option>
													</foreach>
												</select>
											</td>
										</tr>
									-->
										<tr>
											<td>上传路线首图(1张):</td>
											<td>
												<div class="goods_xc_logo" style="width:100px; text-align:center; margin: 5px; display:inline-block;" data="pic">
													<input type="hidden" name="baseinfo[logo][]" value="{$baseinfo.logo}" />
													<a href="{$baseinfo.logo}" target="_blank">
														<img src="{$baseinfo.logo}" width="100" height="100" />
													</a>
													<br/>
													<a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$baseinfo.logo}')">删除</a>
												</div>
												<div class="goods_xc_logo" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
													<input type="hidden" name="baseinfo[logo][]" value="" />
													<a href="javascript:void(0);" onclick="GetUploadify(1,'','info','callback');"><img src="/Public/images/add-button.jpg" width="100" height="100" /></a>
													<br/>
													<a href="javascript:void(0)">&nbsp;&nbsp;</a>
												</div>
											</td>

										</tr>
										<tr>
											<td>上传组图(最多5张):</td>

											<td>
												<volist name="baseinfo.pictures" id="vo">
													<div class="goods_xc" style="width:100px; text-align:center; margin: 5px; display:inline-block;" data="pic">
														<input type="hidden" name="baseinfo[pictures][]" value="{$vo}" />
														<a href="{$vo}" target="_blank">
															<img src="{$vo}" width="100" height="100" />
														</a>
														<br/>
														<a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$vo}')">删除</a>
													</div>

												</volist>
												<div class="goods_xc" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
													<input type="hidden" name="baseinfo[pictures][]" value="" />
													<a href="javascript:void(0);" onclick="GetUploadify(5,'','info','callback2');"><img src="/Public/images/add-button.jpg" width="100" height="100" /></a>
													<br/>
													<a href="javascript:void(0)">&nbsp;&nbsp;</a>
												</div>

											</td>

										</tr>
										<tr>
											<td>准备旅途:</td>
											<td>
												<input type="checkbox" <if condition="$baseinfo['prepare']['charge'] eq 'on'"> checked="checked"</if>name="baseinfo[prepare][charge]" /> 充电器&nbsp;&nbsp;
												<input type="checkbox" <if condition="$baseinfo['prepare']['switcher'] eq 'on'"> checked="checked"</if> name="baseinfo[prepare][switcher]" /> 转换器&nbsp;&nbsp;
												<!--<input type="checkbox" <if condition="$goodsInfo.topic eq 1"> checked="checked"</if>  name="is_recommend" />畅游经典&nbsp;&nbsp;
												<input type="checkbox" <if condition="$goodsInfo.topic eq 1"> checked="checked"</if>  name="is_new" />美食美酒&nbsp;&nbsp;-->
											</td>
										</tr>
										<tr>
											<td>享受旅途:</td>
											<td>
												<input type="checkbox" <if condition="$baseinfo['services']['pick'] eq 'on'">checked checked="checked"</if> name="baseinfo[services][pick]" /> 接机&nbsp;&nbsp;
												<input type="checkbox" <if condition="$baseinfo['services']['flight'] eq 'on'"> checked="checked"</if> name="baseinfo[services][flight]" /> 航班&nbsp;&nbsp;
												<input type="checkbox" <if condition="$baseinfo['services']['hotel'] eq 'on'"> checked="checked"</if> name="baseinfo[services][hotel]" />酒店&nbsp;&nbsp;
												<input type="checkbox" <if condition="$baseinfo['services']['cartype'] eq 'on'"> checked="checked"</if> name="baseinfo[services][cartype]" />车型&nbsp;&nbsp;
												<input type="checkbox" <if condition="$baseinfo['services']['car'] eq 'on'"> checked="checked"</if> name="baseinfo[services][car]" /> 旅行中用车&nbsp;&nbsp;

											</td>
										</tr>

										<!--									
                                <tr>
                                    <td>设置:</td>
                                    <td>
                                    	<input type="checkbox" checked="checked" value="{$goodsInfo.is_on_sale}" name="is_on_sale"/> 上架&nbsp;&nbsp;
	                                <input type="checkbox" checked="checked" value="{$goodsInfo.is_free_shipping}" name="is_free_shipping"/> 包邮&nbsp;&nbsp;
                                        <input type="checkbox" checked="checked" value="{$goodsInfo.is_recommend}" name="is_recommend"/>推荐&nbsp;&nbsp;
                                        <input type="checkbox" checked="checked" value="{$goodsInfo.is_new}" name="is_new"/>新品&nbsp;&nbsp;
                                    </td>
                                </tr>-->

										<!--<tr>
											<td>商品关键词:</td>
											<td>
												<input type="text" class="form-control" style="width:350px;" value="{$goodsInfo.keywords}" name="keywords" />用空格分隔
												<span id="err_keywords" style="color:#F00; display:none;"></span>
											</td>
										</tr>-->
										<!--<tr>
											<td>路线分类:</td>
											<td width="85%">
												<textarea class="span12 ckeditor" id="goods_content" name="goods_content" title="">{$goodsInfo.goods_content}</textarea>
												<span id="err_goods_content" style="color:#F00; display:none;"></span>
											<textarea class="span12 ckeditor" id="goods_content1" name="goods_content" title="">{$goodsInfo.goods_content}</textarea>
										
											</td>	
											
									
										
										</tr>-->
									</tbody>
								</table>
							</div>
							<!--其他信息-->

							<!-- 产品详情-->
							<div class="tab-pane" id="tab_goods_info">
								<table class="table table-bordered">
									<tbody>
										<!--航班-->
										<tr>
											<td style="text-align: center;line-height: 300px;font-weight: bold;">去程航程信息:</td>
											<td>
												航班号：
												<input type="text" value="{$trafficinfo['to']['flightnum']}" name="trafficinfo[to][flightnum]" class="form-control" style="width:350px;" /> 起飞地点：
												<input type="text" value="{$trafficinfo['to']['startplace']}" name="trafficinfo[to][startplace]" class="form-control" style="width:350px;" /> 起飞时间：
												<input type="text" value="{$trafficinfo['to']['starttime']}" name="trafficinfo[to][starttime]" class="form-control" style="width:350px;" /> 降落地点：
												<input type="text" value="{$trafficinfo['to']['endplace']}" name="trafficinfo[to][endplace]" class="form-control" style="width:350px;" /> 降落时间：
												<input type="text" value="{$trafficinfo['to']['endtime']}" name="trafficinfo[to][endtime]" class="form-control" style="width:350px;" /> 航空公司：
												<input type="text" value="{$trafficinfo['to']['company']}" name="trafficinfo[to][company]" class="form-control" style="width:350px;" />

											</td>

										</tr>
										<tr>
											<td style="text-align: center;line-height: 300px;font-weight: bold;">返程航程信息:</td>
											<td>
												航班号：
												<input type="text" value="{$trafficinfo['end']['flightnum']}" name="trafficinfo[end][flightnum]" class="form-control" style="width:350px;" /> 起飞地点：
												<input type="text" value="{$trafficinfo['end']['startplace']}" name="trafficinfo[end][startplace]" class="form-control" style="width:350px;" /> 起飞时间：
												<input type="text" value="{$trafficinfo['end']['starttime']}" name="trafficinfo[end][starttime]" class="form-control" style="width:350px;" /> 降落地点：
												<input type="text" value="{$trafficinfo['end']['endplace']}" name="trafficinfo[end][endplace]" class="form-control" style="width:350px;" /> 降落时间：
												<input type="text" value="{$trafficinfo['end']['endtime']}" name="trafficinfo[end][endtime]" class="form-control" style="width:350px;" /> 航空公司：
												<input type="text" value="{$trafficinfo['end']['company']}" name="trafficinfo[end][company]" class="form-control" style="width:350px;" />

											</td>

										</tr>
										<tr>
											<td style="text-align: center;line-height: 167px;font-weight: bold;">酒店信息:</td>
											<td>
												酒店名：
												<input type="text" value="{$trafficinfo['hotel']['name']}" name="trafficinfo[hotel][name]" class="form-control" style="width:350px;" /> 酒店英文名：
												<input type="text" value="{$trafficinfo['hotel']['ename']}" name="trafficinfo[hotel][ename]" class="form-control" style="width:350px;" /> 酒店位置：
												<input type="text" value="{$trafficinfo['hotel']['position']}" name="trafficinfo[hotel][position]" class="form-control" style="width:350px;" /> 酒店星级：
												<input type="radio" <if condition="$trafficinfo['hotel']['star'] eq 'onestar'"> checked="checked"</if>checked name="trafficinfo[hotel][star]" value="onestar"/>1星&nbsp;&nbsp;
												<input type="radio" <if condition="$trafficinfo['hotel']['star'] eq 'twostar'"> checked="checked"</if>name="trafficinfo[hotel][star]" value="twostar"/>2星&nbsp;&nbsp;
												<input type="radio" <if condition="$trafficinfo['hotel']['star'] eq 'threestar'"> checked="checked"</if> name="trafficinfo[hotel][star]" value="threestar"/>3星&nbsp;&nbsp;
												<input type="radio" <if condition="$trafficinfo['hotel']['star'] eq 'fourstar'"> checked="checked"</if> name="trafficinfo[hotel][star]" value="fourstar"/>4星&nbsp;&nbsp;
												<input type="radio" <if condition="$trafficinfo['hotel']['star'] eq 'fivestar'"> checked="checked"</if>name="trafficinfo[hotel][star]" value="fivestar"/>5星&nbsp;&nbsp;
											</td>

										</tr>

										<tr>
											<td style="text-align: center;line-height: 134px;font-weight: bold;">酒店简介:</td>
											<td>
												<textarea rows="6" cols="50" name="trafficinfo[hotel][intro]">{$trafficinfo['hotel']['intro']}</textarea>
											</td>
										</tr>
										<tr>
											<td style="text-align: center;line-height: 134px;font-weight: bold;">酒店图片(最多上传5张图片):</td>
											<td>
												<volist name="trafficinfo['hotel']['images']" id="vo">
													<div class="goods_xc_hotel" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
														<input type="hidden" name="baseinfo[hotel][images][]" value="{$vo}" />
														<a href="{$vo}" target="_blank">
															<img src="{$vo}" width="100" height="100" />
														</a>
														<br/>
														<a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$vo}')">删除</a>
													</div>

												</volist>
												<div class="goods_xc_hotel" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
													<input type="hidden" name="trafficinfo[hotel][images][]" value="" />
													<a href="javascript:void(0);" onclick="GetUploadify(5,'','goods','callback3');"><img src="/Public/images/add-button.jpg" width="100" height="100" /></a>
													<br/>
													<a href="javascript:void(0)">&nbsp;&nbsp;</a>
												</div>
											</td>
										</tr>
										<tr>
											<td style="text-align: center;line-height: 218px;font-weight: bold;">导游信息:</td>
											<td>
												导游身份：
												<input type="text" value="{$trafficinfo['guide']['status']}" name="trafficinfo[guide][status]" class="form-control" style="width:350px;" /> 导游经验：
												<input type="text" value="{$trafficinfo['guide']['exp']}" name="trafficinfo[guide][exp]" class="form-control" style="width:350px;" /> 导游类型：
												<input type="text" value="{$trafficinfo['guide']['type']}" name="trafficinfo[guide][type]" class="form-control" style="width:350px;" /> 语言能力：
												<input type="text" value="{$trafficinfo['guide']['language']}" name="trafficinfo[guide][language]" class="form-control" style="width:350px;" />
											</td>
										</tr>
									</tbody>
								</table>
							</div>
							<!--产品详情-->

							<!-- 行程安排-->
							<div class="tab-pane" id="tab_goods_schedule">

								<table class="table table-bordered">
									<tbody id="goods_schedule">

										<tr>
											<td>行程:</td>
											<td>
												<div class="btn btn-primary" id="btn-add-schedule" onclick="add_schedule()">添加行程天数</div>
											</td>
										</tr>
										<volist name="scheduleinfo" id="vo" key="count">
											<tr>

												<td style="text-align: center;line-height: 666px;font-weight: bold;">第{$count}天</td>

												<td width="85%">
													路线：
													<input type="text" value="{$vo.route}" name="scheduleinfo[route][]" class="form-control" style="width:350px;" /> 餐饮：
													<input type="text" value="{$vo.food}" name="scheduleinfo[food][]" class="form-control" style="width:350px;" /> 酒店：
													<input type="text" value="{$vo.hotel}" name="scheduleinfo[hotel][]" class="form-control" style="width:350px;" /> 行程：
													<input type="text" value="{$vo.schedule}" name="scheduleinfo[schedule][]" class="form-control" style="width:350px;" /> 具体行程安排：
													<textarea class="span12 ckeditor init" id="goods_content{$key}" name="scheduleinfo[content][]" title="">{$vo.content}</textarea>

												</td>

											</tr>

										</volist>
										<tr style="display: none;" id="day">

											<td style="text-align: center;line-height: 666px;font-weight: bold;" class="daynum">第几天</td>

											<td width="85%">
												路线：
												<input type="text" value="" name="scheduleinfo[route][]" class="form-control" style="width:350px;" /> 餐饮：
												<input type="text" value="" name="scheduleinfo[food][]" class="form-control" style="width:350px;" /> 酒店：
												<input type="text" value="{$goodsInfo.goods_sn}" name="scheduleinfo[hotel][]" class="form-control" style="width:350px;" /> 行程：
												<input type="text" value="{$goodsInfo.goods_sn}" name="scheduleinfo[schedule][]" class="form-control" style="width:350px;" /> 具体行程安排：
												<textarea class="span12 ckeditor" id="goods_content" name="scheduleinfo[content][]" title=""></textarea>

											</td>

										</tr>
							</div>
							</tbody>
							</table>
						</div>
						<!-- 行程安排-->

						<!-- 费用说明-->
						<div class="tab-pane" id="tab_goods_fee">
							<table class="table table-bordered" id="goods_attr_table">
								<tr>
									<td>费用包含:</td>
									<td>
										<textarea rows="6" cols="50" name="goods_remark">{$goodsInfo.p_price}</textarea>
										<td>
								</tr>
								<tr>
									<td>费用不包含:</td>
									<td>
										<textarea rows="6" cols="50" name="goods_remark">{$goodsInfo.p_price}</textarea>
										<td>
								</tr>
							</table>
						</div>
						<!-- 费用说明-->
						<!-- 预定须知-->
						<div class="tab-pane" id="tab_goods_notice">
							<table class="table table-bordered" id="goods_attr_table">
								<tr>
									<td>预定条款:</td>
									<td>
										<textarea rows="6" cols="50" name="goods_remark">{$goodsInfo.p_price}</textarea>
										<td>
								</tr>
								<tr>
									<td>退改政策:</td>
									<td>
										<textarea rows="6" cols="50" name="goods_remark">{$goodsInfo.p_price}</textarea>
										<td>
								</tr>
							</table>
						</div>
						<!-- 预定须知-->
				</div>
				<div class="pull-right">
					<input type="hidden" name="goods_id" value="{$goodsInfo.goods_id}">
					<button class="btn btn-primary" onclick="submitForm()" title="" data-toggle="tooltip" type="button" data-original-title="保存">保存</button>
				</div>
				</form>
				<!--表单数据-->
			</div>
		</div>
</div>
<!-- /.content -->
</section>
</div>
<script>
	var daynum = {$daynum};
	var editor;

	function render_init() {

		var count = 1;
		$('.ckeditor.init').each(function() {

			var id = $(this).attr('id');

			setTimeout("render('" + id + "')", 500 * count);
			count = count + 1;

		})

	}

	function render(id) {
		editor = new UE.ui.Editor(options);
		editor.render(id);

	}

	function add_schedule() {
		var day_template = $('#day').html();
		$('#day').find('.daynum').html('第' + daynum + '天');
		$('#day').find('#goods_content').attr('id', 'goods_content' + daynum);
		var day_new_template = '<tr>' + $('#day').html() + '</tr>';

		$('#day').before(day_new_template);

		$('#day').html(day_template);

		//  指定 textarea 的  id 为 goods_content
		editor = new UE.ui.Editor(options);
		editor.render("goods_content" + daynum);

		daynum = daynum + 1;
	}

	function submitForm() {

		var data = $('#addEditGoodsForm').serialize();

		var url = "{:U('addEditGoodsAjax')}";

		ajax(url, 'post', data, submitFormBack)

	}

	function submitFormBack(res) {
		if(res.status == 1) {
			layer.alert(res.msg, {
				icon: 1,
			}, function() {
				window.location.reload();

			})

		} else {
			layer.alert(res.msg, {
				icon: 2,
			})

		}

	}
</script>
<script>
	/*
	 * 以下是图片上传方法
	 */

	// 上传商品图片成功回调函数
	function callback(paths) {

		var val = $(".goods_xc_logo:eq(0)").attr('data');
		var last_div = $(".goods_xc_logo:last").prop("outerHTML");

		if(val != "pic") {

			$(".goods_xc_logo:eq(0)").before(last_div); // 插入一个 新图片
			$(".goods_xc_logo:eq(0)").attr('data', 'pic');
		}

		$(".goods_xc_logo:eq(0)").find('a:eq(0)').attr('href', paths).attr('onclick', '').attr('target', "_blank"); // 修改他的链接地址
		$(".goods_xc_logo:eq(0)").find('img').attr('src', paths); // 修改他的图片路径
		$(".goods_xc_logo:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr2(this,'" + paths + "')").text('删除');
		$(".goods_xc_logo:eq(0)").find('input').val(paths); // 设置隐藏域 要提交的值

	}

	// 上传商品相册回调函数
	function callback2(paths) {

		var count = $(".goods_xc").length;

		if(count > 5) {

			alert("组图最大数量为5,请删除照片,再上传");
			return;

		}

		var last_div = $(".goods_xc:last").prop("outerHTML");
		for(i = 0; i < paths.length; i++) {
			$(".goods_xc:eq(0)").before(last_div); // 插入一个 新图片
			$(".goods_xc:eq(0)").find('a:eq(0)').attr('href', paths[i]).attr('onclick', '').attr('target', "_blank"); // 修改他的链接地址
			$(".goods_xc:eq(0)").find('img').attr('src', paths[i]); // 修改他的图片路径
			$(".goods_xc:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr2(this,'" + paths[i] + "')").text('删除');
			$(".goods_xc:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
		}
	}

	function callback3(paths) {
		var count = $(".goods_xc_hotel").length;

		if(count > 5) {

			alert("组图最大数量为5,请删除照片,再上传");
			return;

		}
		var last_div = $(".goods_xc_hotel:last").prop("outerHTML");
		for(i = 0; i < paths.length; i++) {
			$(".goods_xc_hotel:eq(0)").before(last_div); // 插入一个 新图片
			$(".goods_xc_hotel:eq(0)").find('a:eq(0)').attr('href', paths[i]).attr('onclick', '').attr('target', "_blank"); // 修改他的链接地址
			$(".goods_xc_hotel:eq(0)").find('img').attr('src', paths[i]); // 修改他的图片路径
			$(".goods_xc_hotel:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr2(this,'" + paths[i] + "')").text('删除');
			$(".goods_xc_hotel:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
		}
	}
	/*
	 * 上传之后删除组图input     
	 * @access   public
	 * @val      string  删除的图片input
	 */
	function ClearPicArr2(obj, path) {
		$.ajax({
			type: 'GET',
			url: "{:U('Admin/Uploadify/delupload')}",
			data: {
				action: "del",
				filename: path
			},
			success: function() {
				$(obj).parent().remove(); // 删除完服务器的, 再删除 html上的图片				 
			}
		});
	}
</script>
</body>

</html>